<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<title th:text="${input}">Title</title>
</head>
<body>
your input is : <span id="input" th:text="${input}">Title</span>
</body>
</html>

<script th:inline="javascript">
var input = [[${input}]];;
document.getElementById("input").innerHTML=input;
</script>